<?php
namespace Home\Controller;
use Think\Controller;

/**
 * 
 * @author Simon
 *
 */
class BaseController extends Controller {
	public $promoter_en = array();

	function _initialize(){
		//验证当前用户是否登陆
    	$login_user_id = cookie(C('AdminConfig.login_cookie_name'));

    	if(!empty($login_user_id)){
    		$this->promoter_en = M('promoterInfo')->where("promoter_id='%s'", $login_user_id)->find();
    		$this->assign('promoter_en', $this->promoter_en);
		}
		$this->addServerConfig();


	}
	
	private function addServerConfig(){
		$ServerConfig = array();
		$ServerConfig['AdminConfig'] = C('AdminConfig');
		$ServerConfig['UrlConfig'] = C('UrlConfig');
	
		$this->assign('ServerConfig', json_encode($ServerConfig));
	}
	
}